<?php
	if(session_id() == '') {
		session_start();
	}
	
	if($_SESSION['userroleid'] != 1)
	{
		$companyName = $_SESSION['companyName'];
	}

?>

<?php echo $LangScript; ?>

<div class="container_head_content">
	<div class="linkbar_container">
		<?php 
		echo "<div class=\"headline\" id=\"headline\">";
		if($_SESSION['userroleid'] != 1)
		{
			echo "<a class='headline_link' href='listusers.php'>" . $companyName . "</a>";
			echo "<p style='font-size:14px;margin:0;' >Powered by Sales Makeover</p>";
			
			
		} else 
		{ 
			echo "<a class='headline_link' href='listusers.php'>Sales Makeover</a>"; 
		} 
		echo "</div>";
		
		?>
		
		
		<div class="linkbar_right">
			<div style='height:32px;'>
				<div style='float:right;'>
					<a href="#" onclick='ChangeLang("en");'><img src="content/icon_eng_default.png" style='padding-top:10px;padding-right:8px;' ></a>
					<a href="#" onclick='ChangeLang("se");'><img src="content/icon_swe_default.png" ></a>
				</div>
			</div>
			<div id="linkbar" style='float:right;width:600px;'>
				<a href="logout.php" class="linkbar_link tr" key="header_LogOut">Logga ut</a>
				
				<?php
				if($_SESSION['userroleid'] == 2)
				{
					echo "<a href=\"listInnovations.php\" class=\"linkbar_link tr\" key=\"header_Innovations\">Innovationer</a>";
					echo "<a href=\"listusers.php\" class=\"linkbar_link tr\" key=\"header_List\" >Lista Användare</a>";

                    }
                    else
                    {
					echo "<a href=\"listusers.php\" class=\"linkbar_link tr\" key=\"header_ListCompany\" >Lista Företag</a>";


                    }
				?>
				
				
			</div>
		</div>
		
	</div>
	
</div>
<script type="text/javascript">

function ChangeLang(lang)
{
	var dataString = 'lang=' + lang;

        $.ajax({

            type: "POST",
            url: "changeLang.php",
            data: dataString,
            cache: false,
            success: function(response) {
                    location.reload();
                }
        });

        return false;
};
$(document).ready(function() {
	$('#linkbar a').each(function(){

		var path = window.location.href;
		var loc = path.substring(path.lastIndexOf('/')+1);
		var url = $(this).attr('href');

		if(url == loc){
			$(this).addClass('current');
		};
	});
});
</script>


<div class = 'WaterMark'>© 2014 Sales Makeover</div>
